The user of a computer typically writes an applications program in a mid or high level language such as Basic, Fortran, Pascal, etc. Before the program can be executed, however, several steps must be performed by the computer to transfer the program into a form which can be executed by the computer. First, a compiler program translates the high level language into machine code. After compilation, the program is then linked by a linkage editor program. The linkage editor creates, from the compiled program, a module of binary code which can be loaded into contiguous memory space in the computer memory. This module of binary code is called an executable module and can be executed by the computer. An Executable Program Format (EPF) is an example of an executable module. The linkage editor may form a single module of code (in binary form) which either can be executed by the CPU without reference to memory locations outside of the EPF module or form a module with external references to subroutines or common memory areas and specifically define, in terms of symbolic addresses, the external references. In other words, an EPF is a program that has been compiled and linked and, therefore, is capable of being run in the processor. An EPF comprises the binary code of the program including commands to the operating system which contain information as to where data should be kept. The EPF also comprises data segments which hold the data needed during the execution of the program.
Computer program instruction flow normally proceeds from one instruction to the next sequential instruction in memory address space. However, programs typically include some instructions which disrupt the normal flow and require jumps in the program routine to remote addresses in order to obtain the next instruction to be executed. The remote address may be within the same EPF or may be external to the EPF. A common example of such a jump is a call to a subroutine which requires the program counter to jump to a remote address to continue the instruction flow. In order to accommodate for these jumps in programming sequence, a pointer is provided in the instruction sequence at the point where the jump is initiated. In a compiled and linked program, i.e., in an EPF, a pointer typically comprises (1) an instruction indicating that the program must invoke the remote procedure and (2) the starting address of the remote procedure. Before linkage, however, external pointers do not comprise a specific memory location but rather are defined as a symbolic address. This situation exists before linkage since external pointer addresses cannot be defined until the program is loaded into memory. All instructions, including the instructions that are at the destination of a pointer have no specific addresses in memory until the program is loaded into memory. An external pointer that does not comprise a specific address in memory is referred to as an unresolved pointer.
Therefore, when a program is loaded into memory, the linkage editor program tries to resolve all the pointers to external objects so that the program will be executable. As noted above, however, external pointers in an EPF may point to symbolic addresses that are external to the EPF. These external pointers typically are to shared memory space, i.e., memory that can be accessed by the EPFs of all users of the computer system. Examples of the types of program segments that are the subject of external pointers are standard sub-routines or other program segments that are provided in a library in memory as part of the computer system.
At the time of loading, the location of the library containing the program is unknown. When the program is run, and an external pointer containing the symbolic address is encountered, the libraries will be searched to find the entry point (i.e. the address of the first instruction of the program) defined by the external pointer. Every EPF which contains an external pointer pointing to the same location also will perform, at run time, the same search for the entry point in order to resolve the external pointer. Since external pointers in an EPF are stored in private memory, the fact that an EPF of another user has already resolved the external pointer does not relieve EPFs of other users from also performing the same search for the identical entry point. The fact that EPFs must perform numerous redundant searches at run time significantly reduces the performance of a computer system.
An improvement over the ordinary linking of EPFs is the registered EPF. In an ordinary EPF, all data is stored within the EPF, which is comprised entirely of private memory. Memory that is private cannot be seen except by a single user. Systems that use registered EPFs allow for certain data to be private and other data to be shared. The term shared means that the data is placed in a location in memory that can be accessed by all users. Some linkages to external pointers are stored in private memory while others are stored in shared memory. As part of the design of the system, decisions are made as to which linkages are private and which are shared.
When the computer system is brought up, the operating system tries to register the EPFs. At this registration time, the operating system of the computer initializes the EPFs. Initialization includes, among other steps unrelated to the present invention, resolving the internal pointers, and storing the run time image of the EPFs in shared memory. It also attempts to resolve the external pointers. Since registered EFPs are stored in shared memory, if a later registered EPF needs to find an entry point in an EPF that had been registered earlier, to resolve an external pointer in its sequence, it can see the first EPF and resolve the external pointer.
The registered EPF system, however, has several shortcomings. First, in the prior art registered EPF system described above, all external references must be resolved at registration time. Another problem with the prior art registration scheme is the fact that, in order for an EPF to be registered, the EPF must resolve all its pointers at registration time. In order to be able to resolve all its pointers, particularly its external pointers, an EPF cannot reference another EPF that has not yet been registered. This leads to two substantial limitations. First, the EPFs must be registered in a very specific order dictated by the dependency of the EPFs upon each other, that is, the first EPF to be registered cannot contain an external pointer to another EPF. The second EPF to be registered can only refer to the first EPF which previously has been registered (or to no EPF at all). The third EPF to be registered can refer only to the first two EPFs and so on down the line. Further, it is absolutely forbidden for there to be cyclic references amongst the EPFs. For instance, if a first EPF referred to a second EPF, the second EPF could not refer to the first EPF. This would cause a situation where the first EPF could not be registered before the second EPF, but by the same token the second EPF could not be registered before the first EPF. In effect, resolved pointers can be only to shared memory or to other EPFs that have previously been registered.
As the number of EPFs increases, keeping track of the EPF dependency tree becomes extremely complicated and burdensome since the number of permutations increases exponentially.
Furthermore, if a previously registered EPF is unregistered and then again registered, all other EPFs that directly or indirectly call this EPF must also be unregistered and then again registered.
Therefore, it is an object of a present invention to provide an improved registered EPF system.
It is a further object of the present invention to provide a registered EPF system wherein EPF linkages can be resolved in any order.
It is another object of the present invention to provide a registered EPF system having increased performance.
It is another object of the present invention to simplify use of a computer system, and to allow sophisticated users greater performance options.